package com.luhuiguo.cms.shared.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.extjs.gxt.ui.client.data.BeanModelTag;

public class ChannelModel implements BeanModelTag, Serializable {

    private static final long serialVersionUID = 2021846499359339453L;

    public static final int STATUS_OPEN = 0;
    public static final int STATUS_CLOSE = 1;

    public static final int TYPE_TRASH = -2;
    public static final int TYPE_DRAFTS = -1;
    public static final int TYPE_COLUMN = 0;
    public static final int TYPE_SITE = 1;

    private Long id;

    private Long parentId;

    private String path;

    private String url;

    private String name;

    private String title;

    private String keywords;

    private String description;

    private int rank;

    private int type;

    private int status;

    private boolean allowPost;

    private boolean allowView;

    private boolean allowComment;

    private Date created;

    private String createdBy;

    private Date lastModified;

    private String lastModifiedBy;

    protected List<ChannelModel> children = new ArrayList<ChannelModel>();

    public ChannelModel() {

    }

    public ChannelModel(Long parentId, String path, String name, String title) {
        super();
        this.parentId = parentId;
        this.path = path;
        this.name = name;
        this.title = title;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isAllowPost() {
        return allowPost;
    }

    public void setAllowPost(boolean allowPost) {
        this.allowPost = allowPost;
    }

    public boolean isAllowView() {
        return allowView;
    }

    public void setAllowView(boolean allowView) {
        this.allowView = allowView;
    }

    public boolean isAllowComment() {
        return allowComment;
    }

    public void setAllowComment(boolean allowComment) {
        this.allowComment = allowComment;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getLastModified() {
        return lastModified;
    }

    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public List<ChannelModel> getChildren() {
        return children;
    }

    public void setChildren(List<ChannelModel> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("ChannelModel [description=").append(description).append(", id=").append(id).append(", name=")
                .append(name).append(", parent=").append(parentId).append(", path=").append(path).append(", rank=")
                .append(rank).append(", status=").append(status).append(", title=").append(title).append(", type=")
                .append(type).append("]");
        return builder.toString();
    }

}
